package com.xpffly.design.observer.jdk.service;

import java.util.Observable;
import java.util.Observer;

/**
 * @Author: 午夜学徒
 * @Date: 2022/4/4 19:23
 * @Description：黄金观察者
 */
public class GoldObserver implements Observer {
    /**
     * This method is called whenever the observed object is changed. An
     * application calls an <tt>Observable</tt> object's
     * <code>notifyObservers</code> method to have all the object's
     * observers notified of the change.
     *
     * @param o   the observable object.
     * @param arg an argument passed to the <code>notifyObservers</code>
     */
    public void update(Observable o, Object arg) {
        System.out.println("收到黄金数据变化的通知.....卖出黄金！！！参数：" + arg);
    }
}
